<div class="row">
    <!-- left column -->
    <div class="col-md-12">
        <!-- general form elements -->
        <div class="box box-primary">
            <div class="box-header with-border">
                <h3 class="box-title">修改内容</h3>
            </div>
            <!-- /.box-header -->
            <!-- form start -->
            <form class="form-horizontal" role="form" method="post" action="/nav/update" enctype="multipart/form-data">
                <input type="hidden" value="{{.UpdateInfo.Model.ID}}" name="ID">
                <div class="box-body">

                    <div class="form-group">
                        <label for="title" class="col-sm-2 control-label">标题</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="title"  placeholder="标题" value="{{.UpdateInfo.Title}}" name="title" required="required">
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="url" class="col-sm-2 control-label">网址</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="url"  placeholder="网址" value="{{.UpdateInfo.Url}}" name="url" required="required">
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="keywords" class="col-sm-2 control-label">关键词</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="keywords"  placeholder="关键词" value="{{.UpdateInfo.Keywords}}" name="keywords" required="required" >
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="desc" class="col-sm-2 control-label">描述</label>
                        <div class="col-sm-10">
                            <div class="box">
                                <div class="box-header">
                                    <h3 class="box-title">CK Editor
                                        <small></small>
                                    </h3>
                                    <div class="pull-right box-tools">
                                        <button type="button" class="btn btn-info btn-sm" data-widget="collapse" data-toggle="tooltip" title="Collapse">
                                            <i class="fa fa-minus"></i>
                                        </button>
                                    </div>

                                </div>
                                <div class="box-body pad">
                                    <textarea name="desc" id="desc" class="form-control" rows="3" placeholder="描述">{{.UpdateInfo.Desc}}</textarea>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="image" class="col-sm-2 control-label">上传截图</label>
                        <div class="col-sm-10">
                            <input type="file" id="image" name="image">
                            <p class="help-block">首页截图</p>
                        </div>
                    </div>

                    {{if ne .UpdateInfo.Image ""}}
                        <div class="form-group">
                            <label for="image" class="col-sm-2 control-label">&nbsp;</label>
                            <div class="col-sm-10">
                                <img src="{{.UpdateInfo.Image}}" width="100" height="100">
                            </div>
                        </div>
                    {{end}}

                    <div class="form-group">
                        <label for="sort" class="col-sm-2 control-label">排序</label>
                        <div class="col-sm-10">
                            <input type="number" class="form-control" id="sort" placeholder="排序" name="sort" value="{{.UpdateInfo.Sort}}" required="required">
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="hits" class="col-sm-2 control-label">点击量</label>
                        <div class="col-sm-10">
                            <input type="number" class="form-control" id="hits" placeholder="点击量" name="hits" value="{{.UpdateInfo.Hits}}" required="required">
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="category_id" class="col-sm-2 control-label">分类</label>
                        <div class="col-sm-10">
                            <select class="form-control" id="category_id" name="category_id" required="required" >
                                <option value="0">公共分类</option>
                                {{range $i, $v := .list}}
                                    <option value="{{$v.ID}}"
                                                {{if eq $v.ID $.UpdateInfo.CategoryId}}
                                                    selected
                                                {{end}}
                                    >{{$v.Name}}</option>
                                {{end}}
                            </select>
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="show_position" class="col-sm-2 control-label">位置</label>
                        <div class="col-sm-10">
                            <select class="form-control" id="show_position" name="show_position" required="required" >
                                <option value="0" {{if eq $.UpdateInfo.CategoryId 0}}selected{{end}}>不显示</option>
                                <option value="1" {{if eq $.UpdateInfo.CategoryId 1}}selected{{end}}>首页</option>
                                <option value="2" {{if eq $.UpdateInfo.CategoryId 2}}selected{{end}}>列表</option>
                            </select>
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="recommend" class="col-sm-2 control-label">推荐位</label>
                        <div class="col-sm-10">
                            {{range $i, $v := .ReList}}
                                <input type="checkbox" name="recommend" id="{{$v.ID}}" value="{{$v.ID}}"
                                        {{range $key,$val := $.Recommend}}
                                            {{if eq $v.ID $val}}
                                                checked
                                            {{end}}
                                        {{end}}
                                > <label for="{{$v.ID}}">{{$v.Title}}</label>
                            {{end}}
                        </div>
                    </div>

                <!-- /.box-body -->

                <div class="box-footer">
                    <button type="submit" class="btn btn-primary">提交</button>
                </div>
                </div>
            </form>
        </div>
        <!-- /.box -->


    </div>
</div>
<script src="/public/adminlit/bower_components/jquery/dist/jquery.min.js"></script>
<!-- Bootstrap WYSIHTML5 -->
<script src="/public/adminlit/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"></script>
<!-- CK Editor -->
<script src="/public/adminlit/bower_components/ckeditor/ckeditor.js"></script>
<!-- Bootstrap WYSIHTML5 -->
<script src="/public/adminlit/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"></script>
<script>
    $(function () {
        CKEDITOR.replace('desc')
    })
</script>